package com.example.aicloud.mapper;

import com.example.aicloud.entity.Discuss;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2025-01-24
 */
public interface DiscussMapper extends BaseMapper<Discuss> {
    @Update("update discuss set readcount = readcount +1 where  did =#{did}")
    int updateReadCount(@RequestParam("did") Long did);

    @Update("update discuss set supportcount = supportcount +1 where  did =#{did}")
    int updateSupportCount(@RequestParam("did") Long did);
}
